//
// Created by Yun on 2025/3/2.
//

#ifndef FRMAEWORK_DEMO_GPIO_BSP_I2C_H
#define FRMAEWORK_DEMO_GPIO_BSP_I2C_H


#include "bsp_common_type.h"
#include "bsp_gpio.h"
#include "i2c_interface.h"


typedef struct I2C_Hw_Cfg {
    I2C_HandleTypeDef stHI2C;
    Gpio_Hw_Cfg_TypeDef     stSCL;
    Gpio_Hw_Cfg_TypeDef     stSDA;
} I2C_Hw_Cfg_TypeDef;


uint8_t Bsp_I2C_Init(void* pI2CHwCfg);

uint8_t Bsp_I2C_Transmit(void* pSpiHwCfg, uint16_t u16Address,uint8_t* pu8TxData,
                         uint16_t u16Len, uint32_t u32TimeOut);

uint8_t Bsp_I2C_Receive(void* pSpiHwCfg, uint16_t u16Address,uint8_t* pu8RxData,
                         uint16_t u16Len, uint32_t u32TimeOut);

extern I2c_Interface_TypeDef stBspI2CInterface;

#endif //FRMAEWORK_DEMO_GPIO_BSP_I2C_H
